Skip to content

(MOT-4412) fix(release): invalidate embedded frontend cache - #788

Merged
ytallo merged 1 commit into
mainfrom
fix/release-frontend-cache-invalidation
Aug 13, 2026
Merged

(MOT-4412) fix(release): invalidate embedded frontend cache#788
ytallo merged 1 commit into
mainfrom
fix/release-frontend-cache-invalidation

Conversation

@ytallo

@ytallo ytallo commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fingerprint Rust release caches with a deterministic digest of every generated frontend bundle
  • verify downloaded frontend artifacts match the digest before compiling each target
  • add contract coverage that prevents frontend-aware cache invalidation from being removed

Root cause

llm-router 1.4.6 was tagged from source containing the fresh-install provider fix, and the frontend build job produced the corrected page.js. The final binary still embedded the previous bundle because the cross-target Cargo cache key represented Rust manifests and locks but not the generated frontend bytes restored afterward.

Impact

A frontend change now selects a different Cargo cache generation for every release target. Identical frontend output keeps its cache reuse, while changed output cannot restore a worker artifact containing stale include_str! or rust-embed data. The digest is verified again after artifact download before compilation.

Testing

  • 177 .github/scripts tests and 3 subtests passed
  • actionlint 1.7.12 passed
  • deterministic frontend digest exercised against llm-router/ui/dist
  • git diff --check

Follow-up to #785.

Refs MOT-4412

Summary by CodeRabbit

  • Bug Fixes

    • Improved release builds by detecting changes in staged frontend assets.
    • Added validation to ensure downloaded frontend bundles match the expected content before compilation.
    • Updated build caching to refresh when frontend bundle contents change.
  • Tests

    • Added automated coverage for frontend digest generation, cache-key integration, and artifact verification.

@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview Aug 13, 2026 12:33am
workers-tech-spec Building Building Preview Aug 13, 2026 12:33am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e441d5a-dbe2-40b6-adbd-d07d8736c856

📥 Commits

Reviewing files that changed from the base of the PR and between f3e95c1 and c07f302.

📒 Files selected for processing (2)
  • .github/scripts/tests/test_release_workflows.py
  • .github/workflows/_rust-binary.yml

📝 Walkthrough

Walkthrough

The Rust binary workflow now publishes a deterministic digest for staged frontend files, includes it in frontend-enabled Cargo cache keys, and verifies restored frontend artifacts on each build shard. Tests cover the output, hashing, cache, and verification wiring.

Changes

Frontend digest validation

Layer / File(s) Summary
Publish digest and key the cache
.github/workflows/_rust-binary.yml
The web-build job publishes staged frontend paths and frontend_digest. The workflow computes the digest from frontend files and includes it in frontend-enabled Cargo cache keys.
Verify restored frontend artifacts
.github/workflows/_rust-binary.yml, .github/scripts/tests/test_release_workflows.py
Build shards compare the restored frontend digest with the expected digest. Tests verify the workflow outputs, hashing, cache wiring, and conditional validation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • iii-hq/workers#591: Introduced related frontend staging and artifact handling in _rust-binary.yml.
  • iii-hq/workers#601: Added the frontend bundling workflow extended by this digest validation.
  • iii-hq/workers#747: Modified the same frontend staging and build-shard artifact flow.

Suggested reviewers: guibeira, sergiofilhowz

Poem

I’m a rabbit guarding bundles bright,
Hashing each file by moonlit light.
Cache keys follow, shard checks agree,
Rust builds only what should be.
Hop, hop—verified with glee!

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/release-frontend-cache-invalidation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 58 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@ytallo
ytallo marked this pull request as ready for review August 13, 2026 00:40
@ytallo
ytallo merged commit 5537be3 into main Aug 13, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant